apiready = function() {

	$api.getUserInf(function(user) {
		if (user) {
			$api.log(user);
			if (user.status == '验证通过') {
				$('#verifyNoPass').remove();
				$('#nickName').text(user.nickName);
				$('#userOwinInf').val(user.unitName + "-" + user.roomNumber);
				if (!user.headimgurl) {
					$('#userHeader').attr('src', user.headimgurl);
				} else {
					$('#userHeader').attr('src', '');
				}
			} else {
				$("#verifyPass").remove();
			}
		}else{
			api.closeWin();
		}
	});
};

function LoginVerify(pt) {
	$api.getUserInf(function(user) {
		if (user.status == '验证通过') {
			switch (pt) {
				case 'repairall':
					{
						$api.mOpenWin('propertyRepairAll', "repairOrder.html", {
							status: 'all'
						});
						break;
					}
				case 'repair':
					{
						$api.mOpenWin('propertyRepair', 'repair.html');
						break;
					}
				case 'bill':
					{
						$api.mOpenWin('propertyBill', "bill.html");
						break;
					}
				case 'notice':
					{
						$api.mOpenWin('propertyNotice', "notice.html");
						break;
					}
				case 'advise':
					{
						$api.mOpenWin('propertyAdvise', "advise.html");
						break;
					}
				case 'contact':
					{
						$api.mOpenWin('propertyContact', "contact.html");
						break;
					}
				case 'profile':
					{
						$api.mOpenWin('propertyProfile', "profile.html");
						break;
					}
				case 'changepw':
					{
						$api.mOpenWin('changepw', "chanpw.html");
						break;
					}
				case 'ownerInfo':
					{
						$api.mOpenWin('ownerInfo', "ownerInfo.html");
						break;
					}
				case 'payment':
					{
						api.openWin({
						    name: 'payment',
						    url: 'payment.html',
						    reload:true
						});
						break;
					}
			}
		} else {
			$api.toastMsg("请先绑定业主信息");
		}

	});
}